package jam;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

/**
 * A unit test that determines whether specific firePower coincides with the appropriate distance
 * performs correctly.
 * 
 * @author John Mack
 * 
 */

public class TestFiringMethod {
  /**
   * Test whether the robot fires the appropriate bullet fire(3) at close range.
   */
  
  @Test
  public void nearEnemy() {
    RunScared robot = new RunScared();
    assertEquals("Fire 3 for distance within 99 pixels",robot.firePower(99), 3);
  }

  /**
   * Test whether the robot fires the appropriate bullet fire(3) at far to normal range.
   */
  
  @Test
  public void farEnemy() {
    RunScared robot = new RunScared();
    assertEquals("Fire 2 for distance between 100 and 999",robot.firePower(999), 2);

  }

  /**
   * Test whether the robot fires the appropriate bullet fire(1) at range that does not meet the
   * first two conditions.
   */
  
  @Test
  public void otherEnemy() {
    RunScared robot = new RunScared();
    assertEquals("Fire 1 for other distances ",robot.firePower(1000), 1);

  }
}
